package com.lovo.web.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
@NoArgsConstructor
@ApiModel(value = "用户实体类",description = "用户实体类")
@TableName("user")
public class UserBean implements Serializable {
    /**
     * 快速注册
     */
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private long userId;//用户id
    @TableField("u_userName")
    private String userName;//用户名
    @TableField("u_pwd")
    private String pwd;//用户密码
    @TableField("u_realName")
    private String realName;//用户真实姓名
    @TableField("u_sex")
    private String sex;//用户性别
    @TableField("u_phone")
    private String phone;//用户电话
    /**
     * 详细注册
     */
    @TableField("u_firm")
    private String firm;//公司名称
    @TableField("u_aptitudeImg")
    private String aptitudeImg;//资质图片
    @TableField("u_idImage")
    private String idImage;//身份证图片
    @TableField("u_isPass")
    private int isPass = 1;//认证状态 0-已认证 1-未认证
    @TableField("u_role")
    private String role;//角色名称
    @TableField("u_money")
    private float money;//预存款余额
    @TableField("u_frozenState")
    private int frozenState = 0;//冻结状态 0-未冻结 1-已冻结
    @TableField("u_frozenCause")
    private String frozenCause;//冻结原因
    @TableField("u_auditState")
    private int auditState = 0;//审核状态 0-审核中 1-审核通过 2-审核失败
    @TableField("u_discount")
    private float discount=0.99f;//初始折扣率
    @TableField("u_nowDiscount")
    private float nowDiscout=0.99f;//现有折扣率
    @TableField(exist = false)
    private UserInfoBean  userInfo;

    /**
     * 快速注册
     * @param userName
     * @param pwd
     * @param realName
     * @param sex
     * @param phone
     */
    public UserBean(String userName, String pwd, String realName, String sex, String phone) {
        this.userName = userName;
        this.pwd = pwd;
        this.realName = realName;
        this.sex = sex;
        this.phone = phone;
    }
}
